-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the default cell marker #7782
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7782 +/- ##
==========================================
- Coverage 59.17% 59.16% -0.02%
==========================================
Files 498 498
Lines 22245 22254 +9
Branches 3573 3578 +5
==========================================
+ Hits 13164 13166 +2
- Misses 8259 8264 +5
- Partials 822 824 +2
Continue to review full report at Codecov.
|
} | ||
|
||
export namespace CodeSnippits { | ||
export const ChangeDirectory = ['{0}', '{1}', 'import os', 'try:', '\tos.chdir(os.path.join(os.getcwd(), \'{2}\'))', '\tprint(os.getcwd())', 'except:', '\tpass', '']; | ||
export const ChangeDirectoryCommentIdentifier = '# ms-python.python added'; // Not translated so can compare. | ||
export const ImportIPython = '#%%\nfrom IPython import get_ipython\n\n'; | ||
export const ImportIPython = '{0}\nfrom IPython import get_ipython\n\n{1}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a second parameter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is used it's concatenated with another string.
In reply to: 331724874 [](ancestors = 331724874)
package.nls.json
Outdated
@@ -218,7 +218,7 @@ | |||
"DataScience.exportingFormat": "Exporting {0}", | |||
"DataScience.exportCancel": "Cancel", | |||
"Common.canceled": "Canceled", | |||
"DataScience.importChangeDirectoryComment": "#%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting", | |||
"DataScience.importChangeDirectoryComment": "# %% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we remove this as well. I.e. if tomorrow a user wants the default to be #%%
, it wont work everywhere as its hardcoded here.
I.e. use string.format as we've done in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.nls.json
Outdated
@@ -340,7 +340,7 @@ | |||
"DataScience.jupyterDebuggerInstallPtvsdYes": "Yes", | |||
"DataScience.jupyterDebuggerInstallPtvsdNo": "No", | |||
"DataScience.cellStopOnErrorFormatMessage": "{0} cells were canceled due to an error in the previous cell.", | |||
"DataScience.instructionComments": "# To add a new cell, type '#%%'\n# To add a new markdown cell, type '#%% [markdown]'\n", | |||
"DataScience.instructionComments": "# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as earlier, string.format
to not hardcode # %%
Fix gather to use new comment Fix formatting on code comments from nls
* Change the default cell marker * Fix test failures Fix gather to use new comment Fix formatting on code comments from nls * Fix unit test too * Fix gather to replace #%%
For #7674